package com.yy.xshell.process.resultHandler;

import com.yy.xshell.core.ShellContext;
import com.yy.xshell.process.Handler;

/**
 * 处理\u0007
 * @author wxy
 * @version 1.0
 * @date 2024/11/25 11:12
 */
public class RingTheBellHandler extends Handler<ShellContext> {

    private static final String reg = "\u0007";

    @Override
    public ShellContext handler(ShellContext command) {
        String msg = command.getMsg();
        msg = msg.replace(reg, "");
        command.setMsg(msg);
        //暂时不做其他处理
        return command;
    }

    @Override
    public boolean accept(ShellContext command) {
        return command.getMsg().contains(reg);
    }
}
